package app.web.netant.hgamecn;

import cn.lily.com.exception.YaconException;
import cn.lily.web.page.BusinessPage;
import cn.lily.web.widget.sql.TSqlGrid;
import cn.lily.web.widget.standard.TButton;
import cn.lily.web.widget.standard.TButtonPilot;
/**
 * Hgamecn 数据页面
 * @author JiaJ
 * @date 2018年6月16日
 *
 */
public class HgamecnPage extends BusinessPage {

	@Override
	public void page_onLoad() throws YaconException {
		
		TSqlGrid hgamecnGrid = sqlGrid("hgamecnGrid");
		
		hgamecnGrid.setDictTable("LEO_HGAMECN_INFO");
		String sqlString = "select GAME_NAME,GAME_NAME_OTH,GAME_FACTORY,"
				         + "to_char(GAME_DATE,'yyyy-mm-dd hh24:mi:ss') GAME_DATE,"
				         + "GAME_TAG,GAME_ID,GAME_PICTOR,GAME_WRITER,GAME_MEMO,"
				         + "GAME_URL,GAME_CAST,GAME_MUSIC,GAME_SINGER "
				         + "from ${schema}.LEO_HGAMECN_INFO ";
		hgamecnGrid.setCommSqlStr(sqlString);
		hgamecnGrid.setEdit(true);
			
		hgamecnGrid.createFieldTitle("GAME_NAME");
		hgamecnGrid.createFieldTitle("GAME_NAME_OTH");
		hgamecnGrid.createFieldTitle("GAME_FACTORY");
		hgamecnGrid.createFieldTitle("GAME_DATE");
		hgamecnGrid.createFieldTitle("GAME_TAG");
		hgamecnGrid.createFieldTitle("GAME_ID").setFieldVisible(false);
		hgamecnGrid.createFieldTitle("GAME_PICTOR").setFieldVisible(false);
		hgamecnGrid.createFieldTitle("GAME_WRITER").setFieldVisible(false);		
		hgamecnGrid.createFieldTitle("GAME_MEMO").setFieldVisible(false);
		hgamecnGrid.createFieldTitle("GAME_URL").setFieldVisible(false);
		hgamecnGrid.createFieldTitle("GAME_CAST").setFieldVisible(false);
		hgamecnGrid.createFieldTitle("GAME_MUSIC").setFieldVisible(false);		
		hgamecnGrid.createFieldTitle("GAME_SINGER").setFieldVisible(false);
		
		TButtonPilot hgamecnPilot = ButtonPilot("hgamecnPilot");
		hgamecnPilot.setPilotIco("/widget/buttonPilot.gif");
		hgamecnPilot.setPilotText("HGameCN网站信息");
		
		hgamecnPilot.addButtons(new TButton("refresh"));
		hgamecnGrid.setButtonPilot(hgamecnPilot);
		
		getPage().addElement(hgamecnGrid);
		
	}
	
	public void refresh() throws YaconException {
		
		TSqlGrid hgamecnGrid = sqlGrid("hgamecnGrid");
		
		hgamecnGrid.setDictTable("LEO_HGAMECN_INFO");
		String sqlString = "select GAME_NAME,GAME_NAME_OTH,GAME_FACTORY,"
				         + "to_char(GAME_DATE,'yyyy-mm-dd hh24:mi:ss') GAME_DATE,"
				         + "GAME_TAG,GAME_ID,GAME_PICTOR,GAME_WRITER,GAME_MEMO,"
				         + "GAME_URL,GAME_CAST,GAME_MUSIC,GAME_SINGER "
				         + "from ${schema}.LEO_HGAMECN_INFO ";
		hgamecnGrid.setCommSqlStr(sqlString);
		
		this.setSelfMessage(hgamecnGrid.getDataElement());
		
	}

}
